package com.jky.trial.mapper;

import com.jky.trial.entity.Category;
import com.jky.trial.entity.Relation;
import com.jky.trial.entity.RelationExample;
import org.apache.ibatis.annotations.Param;

import java.util.List;

public interface RelationMapper {
    long countByExample(RelationExample example);

    int deleteByExample(RelationExample example);

    int deleteByPrimaryKey(Integer id);

    int insert(Relation record);

    int insertSelective(Relation record);

    List<Relation> selectByExample(RelationExample example);

    Relation selectByPrimaryKey(Integer id);

    int updateByExampleSelective(@Param("record") Relation record, @Param("example") RelationExample example);

    int updateByExample(@Param("record") Relation record, @Param("example") RelationExample example);

    int updateByPrimaryKeySelective(Relation record);

    int updateByPrimaryKey(Relation record);

    int addBatch(List<Relation> record);

    /**
     * 列表查询
     * @param record
     * @return
     */
    List<Relation> list(Relation record);

    /**
     * 统计
     * @param record
     * @return
     */
    int count(Relation record);

    /**
     * 根据权限路径查找拥有该权限的用户
     * @param record
     * @return
     */
    List<Relation> findRoleByPermissionName(Category record);

}